import { request } from "@/utils/request";

/**
 * 获取所有留言
 * @returns
 */
export const getallmessage = () => {
  return request.get("/message/getallmessage");
};

/**
 * 回复留言
 * @param user_id 用户id
 * @param message_id 留言id
 * @param content 留言内容
 * @returns
 */
export const replyapi = (
  user_id: number,
  message_id: number,
  content: string
) => {
  return request.post("/message/reply", { user_id, message_id, content });
};

/**
 * 删除留言
 * @param id 留言id
 * @returns
 */
export const deletemessageapi = (id: number) => {
  return request.delete(`/message/deletereply/${id}`);
};

/**
 * 点赞或取消点赞
 * @param message_id 留言id
 * @param user_id 用户id
 * @returns
 */
export const changethumbapi = (message_id: number, user_id: number) => {
  return request.post("/message/changethumb", { message_id, user_id });
};
